#!/usr/bin/bash
#
# Stop and remove all dockers in the VM which is used to deploy T-One
#

FILE=$(readlink -f "${BASH_SOURCE[0]}")
CDIR=$(dirname "$FILE")
NAME=$(basename "$FILE")
TMPDIR=${TMPDIR:-"/tmp"}

function get_docker_ids
{
    typeset ids=$(sudo docker ps --format '{{.ID}}' --all)
    echo "$ids"
}

docker_ids=$(get_docker_ids)
for id in $docker_ids; do
    sudo docker stop $id
done

for id in $docker_ids; do
    sudo docker rm -f $id
done
